package com.youlai.boot.system.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 菜单实体
 *
 * @author Ray
 * @since 2023/3/6
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value = "sys_menu")
public class SysMenuEntity {
    /**
     * 主键ID
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 父菜单ID
     */
    @Column(value = "parent_id")
    private Long parentId;

    /**
     * 菜单名称
     */
    @Column(value = "name")
    private String name;

    /**
     * 菜单类型(1-菜单；2-目录；3-外链；4-按钮权限)
     */
    @Column(value = "type")
    private Integer type;

    /**
     * 路由名称（Vue Router 中定义的路由名称）
     */
    @Column(value = "route_name")
    private String routeName;

    /**
     * 路由路径（Vue Router 中定义的 URL 路径）
     */
    @Column(value = "route_path")
    private String routePath;

    /**
     * 组件路径(vue页面完整路径，省略.vue后缀)
     */
    @Column(value = "component")
    private String component;

    /**
     * 权限标识
     */
    @Column(value = "perm")
    private String perm;

    /**
     * 显示状态(1:显示;0:隐藏)
     */
    @Column(value = "visible")
    private Integer visible;

    /**
     * 排序
     */
    @Column(value = "sort")
    private Integer sort;

    /**
     * 菜单图标
     */
    @Column(value = "icon")
    private String icon;

    /**
     * 跳转路径
     */
    @Column(value = "redirect")
    private String redirect;

    /**
     * 父节点路径，以英文逗号(,)分割
     */
    @Column(value = "tree_path")
    private String treePath;

    /**
     * 【菜单】是否开启页面缓存(1:开启;0:关闭)
     */
    @Column(value = "keep_alive")
    private Integer keepAlive;

    /**
     * 【目录】只有一个子路由是否始终显示(1:是 0:否)
     */
    @Column(value = "always_show")
    private Integer alwaysShow;

    /**
     * 路由参数
     */
    @Column(value = "params")
    private String params;

    /**
     * 创建时间
     */
    @Column(value = "create_time", onInsertValue = "now()")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(value = "update_time", onInsertValue = "now()", onUpdateValue = "now()")
    private Date updateTime;
}